/**
 * Created by bian on 16-3-26.
 */
/**
 * ES6 generators AND co
 * */
var co = require('co');
var Promise = require('bluebird');
//非yield式语言风格
var fs = Promise.promisifyAll(require('fs'));
var result = fs.readFileAsync('step0.js',"utf8");
result.then(function(data){
    //在这里才能处理数据
});
console.log(result); //你不能得到数据，你得到的是Promise

//其必须被包裹在co内
co(function * () {
    var result = yield fs.readFileAsync('step0.js',"utf8");
    console.log(result);
});
/**
 * 框架：koa
 * */

/**
 * 前后端
 * */